import yRequest from '../../index'
import { IDataType } from './type'

export function getPageListData(url: string, queryInfo: object) {
  return yRequest.post<IDataType>({
    url: url,
    data: queryInfo,
    showLoading: true
  })
}
//删除请求
export function deletePageListData(url: string) {
  return yRequest.delete<IDataType>({
    url: url,
    showLoading: true
  })
}
// 创建请求
export function createPageListData(url: string, newData: any) {
  return yRequest.post<IDataType>({
    url: url,
    data: newData,
    showLoading: true
  })
}
// 编辑请求
export function editPageListData(url: string, editData: any) {
  return yRequest.patch<IDataType>({
    url: url,
    data: editData,
    showLoading: true
  })
}
//创建文本
export function createPage(url: string, newData: any) {
  return yRequest.post<IDataType>({
    url: url,
    data: newData,
    showLoading: true
  })
}
